function throttle(fn, time) {
    let flag = true;
    return function (...args) {
        if (flag) {
            flag = false;
            setTimeout(() => {
                fn(...args)
                flag = true;
            }, time)
        }
    }
}